using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Portal.Core.DAL;
using System.ComponentModel;

namespace Portal.BO.Editoral.Question
{
    public class AnswerHelper
    {
        public AnswerHelper()
        { }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public static DataTable Answer_GetListByHoiID(string Hoi_ID)
        {
            using (MainDB objdb = new MainDB())
            {
                return objdb.StoredProcedures.Answer_GetListByHoiID(Hoi_ID);
            }
        }

        public static void DeleteAnswer(string strDap_ID)
        {
            using (MainDB objdb = new MainDB())
            {
                objdb.SelectQuery(" Delete Answer Where Dap_ID IN (" + strDap_ID + ") ");
            }
        }

        public static void Update(string strDap_ID,string content)
        {
            using (MainDB objdb = new MainDB())
            {
                objdb.SelectQuery(" Update Answer Set Dap_Content = N'" + content + "' Where Dap_ID = " + strDap_ID);
            }
        }

        public static DataTable GetAnswerById(string strDap_ID)
        {
            using (MainDB objdb = new MainDB())
            {
                return objdb.SelectQuery(" Select Dap_Content From Answer Where Dap_ID = " + strDap_ID);
            }
        }
    }
}
